import React from 'react';
import { Form, Icon, Input, Radio , Checkbox } from 'antd';

class RadioChecked extends React.Component {


	constructor(props) {
		super(props);
	}


	handleSubmit = e => {
		e.preventDefault();
		this.props.form.validateFields((err, values) => {
			if (!err) {
				console.log('Received values of form: ', values);
			}
		});
	};



	componentDidMount() {
		window.M1=this.props.form
		this.props.form.setFieldsValue({
			username:"sss",
			sex:1

		})
		console.log(this.props.form)

	}



	render() {
		const { getFieldDecorator } = this.props.form;
		return (
			<Form onSubmit={this.handleSubmit} className="login-form">
				<Form.Item>
					{getFieldDecorator('username', {
						rules: [{ required: true, message: 'Please input your username!' }],
					})(
						<Input
							prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
							placeholder="Username"
						/>,
					)}
				</Form.Item>
				<Form.Item>
					{getFieldDecorator('password', {
						rules: [{ required: true, message: 'Please input your Password!' }],
					})(
						<Input
							prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />}
							type="password"
							placeholder="Password"
						/>,
					)}
				</Form.Item>

				<Form.Item>
					{getFieldDecorator('sex', {
						rules: [{ required: true, message: 'Please input your Password!' }],
					})(
						<Radio.Group>
							<Radio value={0}>A</Radio>
							<Radio value={1}>B</Radio>
						</Radio.Group>,
					)}
				</Form.Item>

			</Form>
		);
	}
}

export  default  Form.create({ name: 'normal_login' })(RadioChecked);